/* 
 * File:   TurtleState.cpp
 * Author: Thomas Trojer
 * 
 * Created on 02. Juli 2010, 22:42
 */

#include "TurtleState.h"

TurtleState::TurtleState() {
    code = -1;
    position = Vec4f(0, 0, 0, 0);
    direction = Vec4f(0, 0, 0, 0);
    upwards = Vec4f(0, 0, 0, 0);
}

TurtleState::TurtleState(const TurtleState& orig) {
    code = orig.getCode();

    const Vec4f* pos = orig.getPosition();
    position = Vec4f(*pos);
    
    const Vec4f* dir = orig.getDirection();
    direction = Vec4f(*dir);
    
    const Vec4f* up = orig.getUp();
    upwards = Vec4f(*up);
}

TurtleState::~TurtleState() {}

void TurtleState::setCode(const char c) {
    code = c;
}

const char TurtleState::getCode() const {
    return code;
}

void TurtleState::setPosition(Vec4f pos) {
    position = pos;
}

const Vec4f* TurtleState::getPosition() const {
    return &position;
}

void TurtleState::setDirection(Vec4f dir) {
    direction = dir;
}

const Vec4f* TurtleState::getDirection() const {
    return &direction;
}

void TurtleState::setUp(Vec4f up) {
    upwards = up;
}

const Vec4f* TurtleState::getUp() const {
    return &upwards;
}

void TurtleState::addBranch(TurtleState& branchState) {
    branch.push(branchState);
}

